Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single field validation #35

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Single field validation #35

wants to merge 5 commits into from

Conversation

willrichman
Copy link

This will allow the validation of only one of the registered fields. Can be used to update errors while a field is being edited or when a field resignsFirstResponder.

@jpotts18
Copy link
Collaborator

I feel like this would limit the functionality of the library. Whether you pass in an array of Rules that is size 1 or 100 the library should work the exact same. Is there something particular about your use case that I am not understanding?

@leoyvens
Copy link
Contributor

What about passing a callback to 'validateField' rather than adding a method to the delegate?

@willrichman
Copy link
Author

A callback sounds like a much better idea than the delegate method.

As for the functionality, I'd like to be able to give the user feedback as soon as they start typing, and update that feedback as they type. I do not want to wait to give validation errors and feedback until the user presses submit.

If I currently want to validate one field at a time, I need to unregister all the other fields. I am currently validating a field as soon as the user begins to type, and updating the style transform and error text whenever they type a character. Registering and unregistering fields every time the user switches fields seems less efficient if you don't want every field validating and showing errors at once.

@XBeg9
Copy link

XBeg9 commented Jul 1, 2015

+1

@jpotts18
Copy link
Collaborator

jpotts18 commented Feb 4, 2016

I am sorry but I think I merged in an existing PR for this.

I don't primarily program in Swift anymore and would like to see this library continue to be updated and developed. I have created in issue #81 If you are interested in contributing please talk with me in there.

I won't be closing this PR because I am hopeful that someone will use this code in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants